/**
 * @Author：ming
 * @Date：2023/10/29 9:56 PM
 * @Filename：Hot34
 */

/**
 * @author ming
 */
public class Hot34 {
    public int[] searchRange(int[] nums, int target) {
        int[] index = {-1, -1};
        for (int i = 0; i < nums.length; i++) {
            if(nums[i]==target){
                index[0]=i;
                break;
            }
        }

        for (int i = nums.length-1; i >=0 ; i--) {
            if(nums[i]==target){
                index[1]=i;
                break;
            }
        }
        return index;
    }
}
